using System.Collections;
using System.Collections.Generic;
using AZROLESLib;

namespace AzManContrib.MVC.Initialization
{
    internal class OperationList : List<IAzOperation>, IAzOperations
    {
        /// <summary>
        /// Returns an enumerator that iterates through a collection.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public new IEnumerator GetEnumerator()
        {
            return base.GetEnumerator();
        }

        public new object this[int i]
        {
            get
            {
                return base[i];
            }
            set
            {
                base[i] = (IAzOperation)value;
            }
        }

        public IAzOperation FindByName(string name)
        {
            return !AzMan.IsInitialized ? new FakeOperation(name) : null;
        }
    }
}
